import { ref } from 'vue'
import { settingStore } from '@renderer/store/setStore'
import { playersetStore } from '@renderer/store/playerSet'
import { storeToRefs } from 'pinia'

export default () => {
    let myApi = ref()
    const setStoreData = settingStore()
    const playerSetData = playersetStore()
    const { displayMethod, videoFolders, sort, theme } = storeToRefs(setStoreData)
    const { openMoreVideos } = storeToRefs(playerSetData)

    const changeDisplay = () => {
        displayMethod.value == 'card' ? displayMethod.value = 'list' : displayMethod.value = 'card'
    }
    const changeTheme = () => {
        setStoreData.changeTheme()
    }

    return {
        myApi,
        sort,
        displayMethod,
        videoFolders,
        openMoreVideos,
        setStoreData,
        theme,
        changeTheme,
        changeDisplay
    }
}